import { message } from 'antd';
import dva from 'dva';
import './index.css';
import { browserHistory } from 'dva/router';
import createLoading from 'dva-loading';

// 1. Initialize
const app = dva({
    history: browserHistory,
    onError (error) {
        message.error(error.message)
    },
});

// 2. Plugins
app.use(createLoading());

// 3. Model
app.model(require('./models/Login').default);
app.model(require('./models/Dashboard').default);

// 4. Router
app.router(require('./router').default);

// 5. Start
app.start('#root');
